<template>
    <div class="goods-hot">
      <h3 v-show="type">{{type}}</h3>
      <h3 v-show="type1">{{type1}}</h3>
      <div v-if="goodsList">
        <GoodsItem v-for="item in goodsList" :key="item.id" :goods="item" />
      </div>
    </div>
  </template>
  <script>
  import { gethot } from '@/utils/api/detail'
  import GoodsItem from '@/components/category/GoodsItem.vue'
  export default {
    props: ['type', 'type1', 'goodsId'],
    components: { GoodsItem },
    data() {
      return {
        //   titleObj: { 1: '24小时热销榜', 2: '周热销榜', 3: '总热销榜' },
        //   title: '24小时热销榜'
        goodsList: []
      }
    },
    methods: {
      async getlist() {
        let res = await gethot()
        //  console.log(res);
        this.goodsList = res.result
    //    console.log(this.goodsList);
      }
    },
    mounted() {
      this.getlist()
    },
    computed: {
  
    },
  }
  </script>
  <style scoped lang="scss">
  @import "@/assets/css/variables.scss";
  .goods-hot {
    h3 {
      width: 220px;
      height: 70px;
      background: $helpColor;
      color: #fff;
      font-size: 18px;
      line-height: 70px;
      padding-left: 25px;
      margin-bottom: 10px;
      font-weight: normal;
    }
     .goods-item {
      background: #fff;
      width: 220px;
      margin-bottom: 10px;
      img {
        width: 200px;
        height: 200px;
      }
      p {
        margin: 0 10px;
      }
      &:hover {
        transform: none;
        box-shadow: none;
      }
    }
  }
  </style>